package com.fz.us.oa.core.entity.com;

import com.fz.us.admin.company.entity.BaseFlowEntity;
import com.fz.us.admin.company.entity.User;
import com.fz.us.oa.core.entity.common.FileManage;

import javax.persistence.*;
import java.util.Date;
import java.util.List;
import java.util.Set;

/**
 * 业务实体类 - 会议安排登记表
 * ============================================================================
 * 版权所有 2016 。
 *
 * @author XuHeng
 * @version 1.0 2017-01-04 。
 * ============================================================================
 */
@Entity
@Table(name="ec_meeting")
public class Meeting extends BaseFlowEntity {

    private static final long serialVersionUID = 7982986983731115604L;

    /**
     * 是否外出会议 1:是 0:否
     */
    private int isOut;

    /**
     * 是否公开 1:是 0:否
     */
    private int isPublic;

    /**
     * name == 会议名称
     */

    /**
     * 开始日期
     */
    private Date datStart;
    /**
     * 开始时间
     */
    private Date timStart;
    /**
     * 结束日期
     */
    private Date datEnd;
    /**
     * 结束时间
     */
    private Date timEnd;

    /**
     * 会议议题
     */
    private String subject;

    /**
     * 会议负责人
     */
    private User chief;

    /**
     * 内部参会人员
     */
    private Set<User> participants;

    /**
     * 外部参会人员
     */
    private String outermen;

    /**
     * 会议地点
     */
    private String address;

    /**
     * 会议辅助设备
     */
    private String aidSets;

    /**
     * 其他辅助设备
     */
    private String otherSet;

    /**
     * 取消原因
     */
    private String cancelReason;

    /**
     * 提交日期
     */
    private Date dateApply;
    /**
     * 文档状态数值
     */
    private int numStatus;
    /**
     * 文档状态文字
     */
    private String txtStatus;

    /**
     * 调整日期
     */
    private Date dateUpdate;
    /**
     * 文档调整UNID
     */
    private String updateUnid;

    /**
     * 会议纪要
     */
    private List<FileManage> file;

    /**
     * 表单名称
     */
    private String form;
    /**
     * 会议考勤
     */
    private List<MeetingSign> meetingSigns;

    @Column(nullable=false, columnDefinition = "varchar(50) default '会议安排登记表'")
    public String getForm() {
        return form;
    }

    public void setForm(String form) {
        this.form = form;
    }

    public int getIsOut() {
        return isOut;
    }

    public void setIsOut(int isOut) {
        this.isOut = isOut;
    }

    public int getIsPublic() {
        return isPublic;
    }

    public void setIsPublic(int isPublic) {
        this.isPublic = isPublic;
    }

    public Date getDatStart() {
        return datStart;
    }

    public void setDatStart(Date datStart) {
        this.datStart = datStart;
    }

    public Date getTimStart() {
        return timStart;
    }

    public void setTimStart(Date timStart) {
        this.timStart = timStart;
    }

    public Date getDatEnd() {
        return datEnd;
    }

    public void setDatEnd(Date datEnd) {
        this.datEnd = datEnd;
    }

    public Date getTimEnd() {
        return timEnd;
    }

    public void setTimEnd(Date timEnd) {
        this.timEnd = timEnd;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    public User getChief() {
        return chief;
    }

    public void setChief(User chief) {
        this.chief = chief;
    }

    @ManyToMany(fetch = FetchType.LAZY)
    @OrderBy("pinYinHead asc")
    public Set<User> getParticipants() {
        return participants;
    }

    public void setParticipants(Set<User> participants) {
        this.participants = participants;
    }

    public String getOutermen() {
        return outermen;
    }

    public void setOutermen(String outermen) {
        this.outermen = outermen;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getAidSets() {
        return aidSets;
    }

    public void setAidSets(String aidSets) {
        this.aidSets = aidSets;
    }

    public String getOtherSet() {
        return otherSet;
    }

    public void setOtherSet(String otherSet) {
        this.otherSet = otherSet;
    }

    public String getCancelReason() {
        return cancelReason;
    }

    public void setCancelReason(String cancelReason) {
        this.cancelReason = cancelReason;
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public Date getDateApply() {
        return dateApply;
    }

    public void setDateApply(Date dateApply) {
        this.dateApply = dateApply;
    }

    public int getNumStatus() {
        return numStatus;
    }

    public void setNumStatus(int numStatus) {
        this.numStatus = numStatus;
    }

    public String getTxtStatus() {
        return txtStatus;
    }

    public void setTxtStatus(String txtStatus) {
        this.txtStatus = txtStatus;
    }

    public Date getDateUpdate() {
        return dateUpdate;
    }

    public void setDateUpdate(Date dateUpdate) {
        this.dateUpdate = dateUpdate;
    }

    public String getUpdateUnid() {
        return updateUnid;
    }

    public void setUpdateUnid(String updateUnid) {
        this.updateUnid = updateUnid;
    }

    @ManyToMany(fetch = FetchType.LAZY)
    @JoinTable(name = "ec_meeting_file", joinColumns = @JoinColumn(name="id"),inverseJoinColumns = @JoinColumn(name="fileId"))
    public List<FileManage> getFile() {
        return file;
    }

    public void setFile(List<FileManage> file) {
        this.file = file;
    }

    @ManyToMany(fetch = FetchType.LAZY)
    @JoinTable(name = "ec_meeting_meetingsign", joinColumns = @JoinColumn(name="id"),inverseJoinColumns = @JoinColumn(name="meetingsignId"))
    public List<MeetingSign> getMeetingSigns() {
        return meetingSigns;
    }

    public void setMeetingSigns(List<MeetingSign> meetingSigns) {
        this.meetingSigns = meetingSigns;
    }
}
